using Microsoft.EntityFrameworkCore;
using System.IO;
using DanaZhangCms.DbModels;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using DanaZhangCms.Domain.DbModels;

namespace DanaZhangCms
{


    public class MyContext : IdentityDbContext<User>
    {
        public MyContext(DbContextOptions<MyContext> options)
            : base(options)
        {
        }

        public DbSet<Channel> Channels { get; set; }
        public DbSet<ArticleCategory> ArticleCategorys { get; set; }
        public DbSet<Article> Articles { get; set; }
        public DbSet<Banner> Banners { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);



            modelBuilder.Entity<User>().ToTable("User");

            //  modelBuilder.Entity<Role>().ToTable("Role");


            modelBuilder.Entity<Channel>().ToTable("Channel");
            modelBuilder.Entity<ArticleCategory>().ToTable("ArticleCategory");
            modelBuilder.Entity<Article>().ToTable("Article");
            modelBuilder.Entity<Banner>().ToTable("Banner");
        }
    }

}